Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs/single): support files with .markdown extension #549

Merged

Conversation

kanadgupta
Copy link
Member

🚥 Fix #546

🧰 Changes

Fixes an issue where our single commands had faulty conditional logic and therefore weren't working on .markdown files properly.

Also leans up a few tests, see 21ba907

🧬 QA & Testing

Do the test changes look good and do they pass?

fixing typo, removing unused version param, stricter error checks
@kanadgupta kanadgupta added bug Something isn't working command:docs Issues pertaining to the `docs`, `changelogs`, or `custompages` commands labels Jul 28, 2022
@kanadgupta kanadgupta added this to the v7.5 milestone Jul 28, 2022
@kanadgupta kanadgupta requested a review from erunion July 28, 2022 19:47
@@ -45,7 +45,7 @@ module.exports = class SingleChangelogCommand {
return Promise.reject(new Error(`No file path provided. Usage \`${config.get('cli')} ${this.usage}\`.`));
}

if (filePath.endsWith('.md') === false || !filePath.endsWith('.markdown') === false) {
if (!(filePath.endsWith('.md') || filePath.endsWith('.markdown'))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had case-sensitive filesystems on my mind this week and I'm wondering if we should support .MD and .Markdown, or any casing variation of them.

@@ -45,7 +45,7 @@ module.exports = class SingleChangelogCommand {
return Promise.reject(new Error(`No file path provided. Usage \`${config.get('cli')} ${this.usage}\`.`));
}

if (filePath.endsWith('.md') === false || !filePath.endsWith('.markdown') === false) {
if (!(filePath.endsWith('.md') || filePath.endsWith('.markdown'))) {
return Promise.reject(new Error('The file path specified is not a markdown file.'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be capitalized?

Suggested change
return Promise.reject(new Error('The file path specified is not a markdown file.'));
return Promise.reject(new Error('The file path specified is not a Markdown file.'));

@kanadgupta kanadgupta requested a review from erunion July 28, 2022 20:53
@kanadgupta kanadgupta merged commit ce220de into kanad/rm-4889-custom-pages-support Jul 28, 2022
@kanadgupta kanadgupta deleted the fix/docs-changelog/markdown-ext branch July 28, 2022 20:57
kanadgupta added a commit that referenced this pull request Jul 28, 2022
* chore: create custompages cmd category

* test: fixtures

* feat: initial pass at commands

as part of this, we had to slightly refactor the pushDoc function to augment the data to support the HTML file handling required by the custompages API

* test: initial pass at tests

* docs: update README usage

* test: remove unused version params, stricter error checks

* fix(docs/single): support files with `.markdown` extension (#549)

* fix: support files with .markdown extension

* test: random cleanup

fixing typo, removing unused version param, stricter error checks

* chore: capitalize Markdown

* chore: lowercase all file extension checks

* refactor: DRY some docs logic (#550)

* fix: support files with .markdown extension

* test: random cleanup

fixing typo, removing unused version param, stricter error checks

* refactor: DRY some docs logic

* feat: add retag-release workflow to add a vX.Y.Z tag for our GitHub Action (#545)

* feat: add retag-release workflow to add a vX.Y.Z tag for our GitHub Action

* Update .github/workflows/retag-release.yaml

Co-authored-by: Kanad Gupta <[email protected]>

* refactor: move code out of YAML and into bin/ script

* fix: lint fixes

Co-authored-by: Kanad Gupta <[email protected]>

Co-authored-by: Ryan Park <[email protected]>

Co-authored-by: Ryan Park <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working command:docs Issues pertaining to the `docs`, `changelogs`, or `custompages` commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants